/**
 * @file SDLStaticRepresentation.cpp
 *
 *  @date 16-nov-2009
 *  @author Ives
 */

#include "SDLStaticRepresentation.h"
#include <SDL.h>
#include <SDL_image.h>
#include <cassert>
#include "SDLZoomDrawer.h"
#include "SDLException.h"
#include "SDLWindow.h"


si_sdl::SDLStaticRepresentation::SDLStaticRepresentation()
{

}
si_sdl::SDLStaticRepresentation::~SDLStaticRepresentation()
{
}



void si_sdl::SDLStaticRepresentation::draw(si::Vector2 virtualPosition, si::Vector2 virtualSize)
{
	// zoom ?
	if(virtualSize.getX() != 0.0 || virtualSize.getY() != 0.0)
		SDLZoomDrawer::get()->draw(fMe, fResized, virtualSize, virtualPosition);
	else //don't zoom
		SDLZoomDrawer::get()->drawNoScale(fMe, virtualPosition);






}



void si_sdl::SDLStaticRepresentation::update(double time)
{
}

si::Vector2 si_sdl::SDLStaticRepresentation::getSize() const
{
	return si::Vector2(fMe->w, fMe->h);
}

void si_sdl::SDLStaticRepresentation::merge(SDLStaticRepresentation& in, si::Vector2 position)
{
	SDL_Rect r;
	r.x = position.getX();
	r.y = position.getY();

	SDL_BlitSurface(in.fMe.get(), 0, fMe.get(), &r);


}
















